package com.yqg.protection.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yqg.protection.cover.LocalDateTimeConverter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * record_operate 实体类
 *
 * @author 小宇
 * @since 2024-09-13
 */
@Getter
@Setter
@TableName("record_operate")
@ApiModel(value = "RecordOperate对象", description = "")
public class RecordOperate implements Serializable {

    private static final long serialVersionUID = 1L;

    @ExcelProperty(value = "ID", index = 0)
    @ApiModelProperty("自增id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ExcelProperty(value = "用户ID", index = 1)
    @ApiModelProperty("用户ID")
    private Long userId;

    @ExcelProperty(value = "用户名", index = 2)
    @ApiModelProperty("用户名")
    @TableField(exist = false)
    private String userName;

    @ExcelProperty(value = "操作类型", index = 3)
    @ApiModelProperty("操作类型")
    private String operateType;

    @ExcelProperty(value = "操作内容", index = 4)
    @ApiModelProperty("操作内容")
    private String content;

    @ApiModelProperty("参数")
    @ExcelIgnore
    private String params;

    @ExcelProperty(value = "用户IP", index = 5)
    @ApiModelProperty("用户IP")
    private String userIp;

    @ExcelProperty(value = "操作时间", index = 6, converter = LocalDateTimeConverter.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty("操作时间")
    private LocalDateTime createdTime;

    @ExcelIgnore
    private Integer isDelete;

}
